home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / SCRIB6.PAK / MAINFRM.CPP < prev    next >
C/C++ Source or Header  |  1997-05-06  |  3KB  |  122 lines

  1. // MainFrm.cpp : implementation of the CMainFrame class
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1992-1995 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13. #include "stdafx.h"
  14. #include "Scribble.h"
  15.  
  16. #include "MainFrm.h"
  17.  
  18. #ifdef _DEBUG
  19. #define new DEBUG_NEW
  20. #undef THIS_FILE
  21. static char THIS_FILE[] = __FILE__;
  22. #endif
  23.  
  24. /////////////////////////////////////////////////////////////////////////////
  25. // CMainFrame
  26.  
  27. IMPLEMENT_DYNAMIC(CMainFrame, CMDIFrameWnd)
  28.  
  29. BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
  30.     //{{AFX_MSG_MAP(CMainFrame)
  31.         // NOTE - the ClassWizard will add and remove mapping macros here.
  32.         //    DO NOT EDIT what you see in these blocks of generated code !
  33.     ON_WM_CREATE()
  34.     //}}AFX_MSG_MAP
  35.     ON_COMMAND(ID_HELP_FINDER, CMDIFrameWnd::OnHelpFinder)
  36.     ON_COMMAND(ID_HELP, CMDIFrameWnd::OnHelp)
  37.     ON_COMMAND(ID_CONTEXT_HELP, CMDIFrameWnd::OnContextHelp)
  38.     ON_COMMAND(ID_DEFAULT_HELP, CMDIFrameWnd::OnHelpFinder)
  39. END_MESSAGE_MAP()
  40.  
  41. static UINT indicators[] =
  42. {
  43.     ID_SEPARATOR,           // status line indicator
  44.     ID_INDICATOR_CAPS,
  45.     ID_INDICATOR_NUM,
  46.     ID_INDICATOR_SCRL,
  47. };
  48.  
  49. /////////////////////////////////////////////////////////////////////////////
  50. // CMainFrame construction/destruction
  51.  
  52. CMainFrame::CMainFrame()
  53. {
  54.     // TODO: add member initialization code here
  55.     
  56. }
  57.  
  58. CMainFrame::~CMainFrame()
  59. {
  60. }
  61.  
  62. int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
  63. {
  64.     if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
  65.         return -1;
  66.     
  67.     if (!m_wndToolBar.Create(this) ||
  68.         !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
  69.     {
  70.         TRACE0("Failed to create toolbar\n");
  71.         return -1;      // fail to create
  72.     }
  73.  
  74.     if (!m_wndStatusBar.Create(this) ||
  75.         !m_wndStatusBar.SetIndicators(indicators,
  76.           sizeof(indicators)/sizeof(UINT)))
  77.     {
  78.         TRACE0("Failed to create status bar\n");
  79.         return -1;      // fail to create
  80.     }
  81.  
  82.     // TODO: Remove this if you don't want tool tips
  83.     m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
  84.         CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
  85.     
  86.     // TODO: Delete these three lines if you don't want the toolbar to
  87.     //  be dockable
  88.     m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
  89.     EnableDocking(CBRS_ALIGN_ANY);
  90.     DockControlBar(&m_wndToolBar);
  91.  
  92.  
  93.     return 0;
  94. }
  95.  
  96. BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
  97. {
  98.     // TODO: Modify the Window class or styles here by modifying
  99.     //  the CREATESTRUCT cs
  100.  
  101.     return CMDIFrameWnd::PreCreateWindow(cs);
  102. }
  103.  
  104. /////////////////////////////////////////////////////////////////////////////
  105. // CMainFrame diagnostics
  106.  
  107. #ifdef _DEBUG
  108. void CMainFrame::AssertValid() const
  109. {
  110.     CMDIFrameWnd::AssertValid();
  111. }
  112.  
  113. void CMainFrame::Dump(CDumpContext& dc) const
  114. {
  115.     CMDIFrameWnd::Dump(dc);
  116. }
  117.  
  118. #endif //_DEBUG
  119.  
  120. /////////////////////////////////////////////////////////////////////////////
  121. // CMainFrame message handlers
  122.